package com.example.demo.controller;

import com.alibaba.fastjson.JSON;
import com.example.demo.nacos.CMBBankConfig;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

@RefreshScope
@RestController
public class TestController {

    @Resource
    public CMBBankConfig config;


    @RequestMapping(value = "/test", method = GET)
    public String test() {
        String cc = JSON.toJSONString(config);
        System.out.println("cc.." + cc);
        return cc;
    }
}